<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <style type="text/css">
        thead tr th {
            text-align: center !important;
        }

        tr td {
            text-align: center !important;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <form action="/account/moneyDetail" id="seachFrom" class="layui-form">
                    <div class="layui-card-body">
                        <%-- 查询条件设置 --%>
                        <div class="layui-container" style="padding-bottom: 50px">
                            <div class="layui-col-md12">
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">明细时间：</div>
                                    <div class="layui-col-sm7">
                                        <input class="layui-input" name="queryTime" id="laydate-cn" autocomplete="off">
                                    </div>
                                </div>
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">流水号：</div>
                                    <div class="layui-col-sm7">
                                        <input type="text" name="payCode" class="layui-input" value="${details.payCode}">
                                    </div>
                                </div>
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">操作类型：</div>
                                    <div class="layui-col-sm7">
                                        <select name="typeId">
                                            <option value="">全部</option>
                                            <c:forEach items="${handleList}" var="h">
                                                <option value="${h.id}"
                                                        <c:if test="${details.typeId==h.id}">selected</c:if>>${h.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md12">
                              <%--  <div class="layui-col-md4">
                                    <div class="layui-col-sm3" style="line-height: 38px">线上/线下：</div>
                                    <div class="layui-col-sm7">
                                        <select name="onOff">
                                            <option value="">全部</option>
                                            <option value="0">线上</option>
                                            <option value="1">线下</option>
                                        </select>
                                    </div>
                                </div>--%>
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm6">
                                        <button class="layui-btn layui-btn" type="submit">查询</button>
                                        <button class="layui-btn layui-btn-warm exportThis" data-type="exportThis" type="button">导出</button>
                                    </div>
                                </div>
                                <div class="layui-col-md4">
                                    <div class="layui-col-sm6">
                                        <button class="layui-btn layuiadmin-btn-useradmin cashThis" data-type="cashThis" type="button">提现</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md12"><hr></div>
                    </div>
                    <%-- 数据展示 --%>
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>流水号</th>
                            <th>类型</th>
                           <%-- <th>线上/线下</th>--%>
                            <th>收支</th>
                            <th>原始金额</th>
                            <th>操作金额</th>
                            <th>最后金额</th>
                            <th>创建时间</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${pageInfo.records}" var="l">
                            <tr>
                                <td>${l.payCode}</td>
                                <td>${l.typeName}</td>
                               <%-- <td>${l.onOff == 0 ?'线上':'线下'}</td>--%>
                                <td>${l.isout==1?'收入':'支出'}</td>
                                <td>${l.original}</td>
                                <td>${l.cost}</td>
                                <td>${l.last}</td>
                                <td><fmt:formatDate value="${l.createTime}"
                                                    pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                <td>${l.remark}</td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <div class="test-table-reload-btn" style="margin-top: 10px;">
                        <%@include file="../paging.jsp" %>
                    </div>
            </div>
            </form>
        </div>
    </div>
</div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate'], function () {
        var $ = layui.$, layer = layui.layer, form = layui.form,
            element = layui.element, laydate = layui.laydate;
        form.render('select');
        element.render();
        laydate.render({
            elem: '#laydate-cn',
            range: '~'
        });

        var active = {
            cashThis: function () {
                window.location.href = "/account/businessCash";
            }
        };

        $(".cashThis").on("click", function () {
            var cashThis = $(this).data("type");
            active[cashThis] && active[cashThis].call(this);
        });
    });
</script>
</body>
</html>